import request from './request'

// 获取指定ID的问诊记录
export const getConsultationRecordApi = id => request.get(`/consultation-records/${id}`)

// 获取当前用户的问诊记录列表
export const getCurrentUserConsultationRecordsApi = () => request.get('/consultation-records/current')

// 创建问诊记录
export const createConsultationRecordApi = data => request.post('/consultation-records', data)

// 更新问诊记录
export const updateConsultationRecordApi = (id, data) => request.put(`/consultation-records/${id}`, data)

// 删除问诊记录
export const deleteConsultationRecordApi = id => request.delete(`/consultation-records/${id}`)
export const deleteInquiryApi = id => request.delete(`/consultation-records/${id}`)

// 根据日期范围获取问诊记录
export const getConsultationRecordsByDateRangeApi = (startDate, endDate) => request.get('/consultation-records/date-range', {
    params: { startDate, endDate }
})

// 回复问诊
export const replyInquiryApi = (data) => request.put(`/consultation-records/${data.id}`, { reply: data.reply }) 